<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
   <meta charset="utf-8" />
   <title>利导科技客户关系管理系统 | 任务列表</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta content="width=device-width, initial-scale=1.0" name="viewport" />
   <meta content="" name="description" />
   <meta content="" name="author" />
   <meta name="MobileOptimized" content="320">
   <!-- BEGIN GLOBAL MANDATORY STYLES -->          
   <link href="${base}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/jquery-multi-select/css/multi-select.css" />
   <!-- END GLOBAL MANDATORY STYLES -->
   <!-- BEGIN PAGE LEVEL STYLES -->
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/select2/select2_metro.css" />
   <link rel="stylesheet" href="${base}/assets/plugins/data-tables/DT_bootstrap.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-datepicker/css/datepicker.css">
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-timepicker/compiled/timepicker.css">
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css">
   <!-- END PAGE LEVEL STYLES -->
   <!-- BEGIN THEME STYLES --> 
   <link href="${base}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
   <link href="${base}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
   <!-- END THEME STYLES -->
   <link rel="shortcut icon" href="${base}/assets/img/favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
   <#include "header.ftl">
   <div class="clearfix"></div>
   <!-- BEGIN CONTAINER -->
   <div class="page-container">
      <!-- BEGIN SIDEBAR -->
      <#include "main_menu.ftl">
      <!-- END SIDEBAR -->
      <!-- BEGIN PAGE -->
      <div class="page-content">
      	<#include "changePassword.ftl">
         <#include "system-set.ftl">
         <#include "viewTracking.ftl">
         <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
         <div class="modal" id="ViewContacts" tabindex="-1" role="basic" aria-hidden="true">
            <div class="modal-dialog modal-wide">
               <div class="modal-content">
                  <div class="modal-header">
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                     <h4 class="modal-title">查看事项</h4>
                  </div>
                  <div class="modal-body">
                  	<form id="form_contacts" class="form-horizontal">
                     
                    </form> 
                  </div>
                  <div class="modal-footer">
                     <button type="button" class="btn default" data-dismiss="modal">Close</button>
                  </div>
               </div>
               <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
         </div>
         <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
         <!-- BEGIN PAGE HEADER-->
         <div class="row">
            <div class="col-md-12">
               <!-- BEGIN PAGE TITLE & BREADCRUMB-->
			   <h3 class="page-title">
			   	任务列表<small>这里显示员工的任务列表</small>
			   </h3>
			   <ul class="page-breadcrumb breadcrumb">
			      <li>
			         <i class="icon-home"></i>
			         <a href="${base}/admin/admin!main.action">Home</a> 
			         <i class="icon-angle-right"></i>
			      </li>
			      <li>
			         <a href="#">日常管理</a>
			         <i class="icon-angle-right"></i>
			      </li>
			      <li>
			      	<a href="${base}/admin/toDoItem!myCustomer.action">任务列表</a>
			      </li>
			     
			   </ul>
			   <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
         </div>
         <!-- END PAGE HEADER-->
         <!-- BEGIN PAGE CONTENT-->
         <div class="row">
            <div class="col-md-12">
               <!-- BEGIN EXAMPLE TABLE PORTLET-->
               <div class="portlet box blue">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-reorder"></i>任务列表</div>
                     <div class="actions">
                        <a href="${base}/admin/dbsx!add.action" class="btn blue"><i class="icon-pencil"></i> 新建</a>
                        <div class="btn-group">
                           <a class="btn blue" href="#" data-toggle="dropdown">
                           <i class="icon-cogs"></i> 菜单
                           <i class="icon-angle-down"></i>
                           </a>
                           <ul class="dropdown-menu pull-right">
                              <li><a href="javascript:;" id = "Duplicate"><i class="icon-copy"></i> 复制</a></li>
                              <li class="divider"></li>
                              <li><a href="javascript:;" id = "Export"><i class="icon-signout"></i> 导出到Excel</a></li>
                              <li><a href="javascript:;" id = "Import"><i class="icon-signin"></i> 从Exce导入</a></li>
                           </ul>
                        </div>
                     </div>
                  </div>
                  <div class="portlet-body">
                     <table class="table table-striped table-bordered table-hover" id="dbsx">
                        <thead>
                           <tr>
                              <th style="width:8px;"><input type="checkbox" class="group-checkable" data-set="#dbsx .checkboxes" /></th>
                              <th class="hidden-480">状态</th>
                              <th class="hidden-480">主题</th>
                              <th class="hidden-480">创建人</th>
                              <th class="hidden-480">联系人</th>
                              <th class="hidden-480">联系电话</th>
                              <th class="hidden-480">提醒时间</th>
                              <th class="hidden-480">创建时间</th>
                              <th class="hidden-480">操作</th>
                           </tr>
                        </thead>
                        <tbody>
                           <#if toDoItemList?exists>
	                        	<#list toDoItemList as toDoItem>
		                           <tr class="odd gradeX">
		                              <td><input type="checkbox" class="checkboxes" value="${toDoItem.id}" /></td>
		                              <td class="hidden-480">
		                              	<#if toDoItem.status == "未完成">
		                              			<span style = "color:red">${toDoItem.status}</span></td>
		                              		<#else>
		                              			<span>${toDoItem.status}</td>
		                              	</#if>
		                              </td>
		                              <td class="hidden-480"><#if toDoItem.theme?exists>${toDoItem.theme}</#if></td>
		                              <td class="hidden-480"><#if toDoItem.follower?exists>${toDoItem.follower}</#if></td>
		                              <td class="hidden-480"><#if toDoItem.lxr?exists>${toDoItem.lxr}</#if></td>
		                              <td class="hidden-480"><#if toDoItem.lxdh?exists>${toDoItem.lxdh}</#if></td>
		                              <td class="hidden-480"><#if toDoItem.remindTime?exists>${toDoItem.remindTime}</#if></td>
		                              <td class="hidden-480"><#if toDoItem.createTime?exists>${toDoItem.createTime}</#if></td>
		                              <td class="hidden-480">
		                              	<a href = "${base}/admin/dbsx!findById.action?id=${toDoItem.id}">编辑</a>
		                              	<input type="hidden" id = "ID" value="${toDoItem.id}" />
		                              	<a class = "Delete" href = "javascript:;">删除</a>
		                              </td>
		                           </tr>
	                           </#list>
                           </#if>
                        </tbody>
                     </table>
                  </div>
               </div>
               <!-- END EXAMPLE TABLE PORTLET-->
            </div>
         </div>
         <!-- END PAGE CONTENT-->
      </div>
      <!-- END PAGE -->
   </div>
   <!-- END CONTAINER -->
   <#include "footer.ftl">
   <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
   <#include "coreJsPlugins.ftl">
   <!-- BEGIN PAGE LEVEL PLUGINS -->
   <script type="text/javascript" src="${base}/assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/select2/select2.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/data-tables/jquery.dataTables.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/data-tables/DT_bootstrap.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/jquery-multi-select/js/jquery.multi-select.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/jquery-multi-select/js/jquery.quicksearch.js"></script>
   <!-- END PAGE LEVEL PLUGINS -->
   <!-- BEGIN PAGE LEVEL SCRIPTS -->
   <script src="${base}/assets/scripts/app.js"></script>
   <script src="${base}/resources/scripts/toDoItem-managed.js"></script>
   <script>
      jQuery(document).ready(function(){
         App.init();
         ToDoItemManaged.init();
         
         if (jQuery().datepicker) {
            $('.date-picker').datepicker({
                rtl: App.isRTL(),
                autoclose: true
            });
            $('body').removeClass("modal-open"); // fix bug when inline picker is used in modal
        }
        
        /**
        	删除待办事项
        */
        $(".Delete").click(function(){
        	var id = $(this).prev().val();
        	if(confirm("提示！是否删除此条记录?")==true){
        		$.ajax({
    	            type:"post",
    	            url:"/crm/admin/dbsx!delete.action",
    	            dataType:"json",
    	            data:"id="+id,
    	            cache:false,
    	            beforeSend:function(XMLHttpRequest){
    	            },
    	            success:function(json){
    	            	result = json.result;
    	            	if(result){
    	            		window.location.href="/crm/admin/dbsx!list.action";
    	            		alert("删除成功");
    	            	}else{
    	            		alert("程序异常,请与开发人员联系!");
    	            	}
    	            },
    	           	complete:function(XMLHttpRequest,textStatus){
    	           	},
    	          	error:function(XMLHttpRequest,textStatus,errorThrown){
    	                   alert("网络错误，请稍后重试!");
    	          	}
                });
        	}else{
        		
        	}
        });
      });
     
     
   </script>
</body>
<!-- END BODY -->
</html>